<extend name="Public/base"/>
<block name="style">
<link rel="stylesheet" type="text/css" href="__STATIC__/bootstrap-fileinput/css/fileinput.css">	
</block>
<block name="content">
<h3>曲风管理</h3>
<div class="panel panel-default">
	<div class="panel-heading"><{:isset($data['id'])?'编辑':'新增'}>曲风</div>
 	<div class="panel-body">
		<form class="form-horizontal" enctype="multipart/form-data" action="<{:U()}>" name="songs"  method="post">													
			<div class="form-group">	
				<label class="col-sm-2 control-label">曲风名称</label>
				<div class="col-sm-2">
					<input  type="text" name="name" class="form-control" value="<{$data.name|default=''}>" >					
				</div>
				<span class="help-inline">此项不能为空</span>	
		    </div>		
    		<div class="form-group">	
    			<label class="col-sm-2 control-label">曲风封面</label>
    			<div class="col-sm-5">
    				<div class="input-group">
    					<input type="hidden" name="cover_id" id="cover_id" value="<{$data.cover_id| default='0'}>">
    					<input type="text" class="form-control" name="cover_url" id="cover"  value="<notempty name="data['cover_id']"> <{$data.cover_url}></notempty>">
    					<a href="javascript:;" class="input-group-addon up_pic" rel_url="#cover" rel_fileid="#cover_id"  url="<{:U('File/uploadPicture',array('session_id'=>session_id(),'type'=>'genre'))}>">
                        	<span class="fa fa-cloud-upload"></span>
                    	</a>
                    	<notempty name="data['cover_id']">
                    	<a href="javascript:;" class="input-group-addon look_pic" >预览</a>
                    	</notempty>
                    </div>    				
    			</div>
    			<span class="help-block">本地上传自动获取URL,可填写外链</span>
    		</div> 
			<div class="form-group">
				<label class=" col-sm-2  control-label">上级曲风</label>
				<div class="col-sm-3">
	    			<select name="pid" class="form-control">
	        		<volist name="Genres" id="genre">	        			
	            		<option <notempty name="data"> <if condition="$data['pid'] eq $genre['id'] ">selected='selected'</if></notempty> value="<{$genre.id}>"><{$genre.title_show}></option>
	        		</volist>
	    			</select>	
				</div>
				<p class="help-block">所属的上级曲风</p>
			</div>		
    		<div class="form-group">	
    			<label class="col-sm-2 control-label">是否推荐</label>
    			<div class="col-sm-6 controls">
					<input class="hide" name="recommend" value="<{$data['recommend'] |default='0'}>">
					<div class="switch-wrapper">
						<span class="switch-enable">是</span>
						<span class="switch-disable selected">否</span>
					</div>
					<present name="data">
					<if condition="$data.recommend == 1">					
						<script type="text/javascript">
							$('.switch-disable').removeClass('selected');
							$('.switch-enable').addClass('selected');
						</script>	
					</if>
					</present>
                </div>							
    		</div>
    		
    		<div class="form-group">	
				<label class=" col-sm-2 control-label">标题</label>
				<div class="col-sm-3">
					<input  type="text"  name="title" value="<{$data.title|default=''}>" class="form-control">					
				</div>
				<span class="help-block">SEO标题</span>
			</div>	
			
			<div class="form-group">	
				<label class=" col-sm-2 control-label">关键字</label>
				<div class="col-sm-3">
					<input  type="text"  name="kerwords" value="<{$data.kerwords|default=''}>" class="form-control">					
				</div>
				<span class="help-block">SEO关键字</span>
			</div>					
					
		    <div class="form-group">		
				<label class="col-sm-2 control-label">曲风描述</label>
				<div class="col-sm-4">	
					<textarea name="description" style="width:300px;height:80px;" ><{$data.description|default=''}></textarea>
		    	</div>
		    </div>			 
									
    		<div class="form-group">
    			<input type="hidden" name="status" value="<{$data.status|default=''}>">
    			<input type="hidden" name="id" value="<{$data.id|default=''}>">      		
            	<div class="col-sm-4 col-sm-offset-2">
                	<button class="btn btn-default" type="button" onclick="javascript:history.back(-1);return false;">取消</button>
                	<button class="btn btn-primary ajax-post" target-form="form-horizontal" type="submit">保存</button>
            	</div>
        	</div>
        </form>
	</div>
</div>
<div class="col-md-12 upload-content" id="file-up">		                    	
	<div class="upload-box">
		<div class="dz-default dz-message  fileinput-button">
			<span>点击或将文件拖拽到这里</span>		                    		
		    <input id="fileupload" type="file" name="user_file" multiple>
	    </div>
	    <div id="files" class="files"></div>
		<div id="progress" class="progress">
	        <div class="progress-bar progress-bar-info"></div>
	    </div>
	</div>
</div>  
</block>
<block name="script">
<script type="text/javascript" src="__STATIC__/bootstrap-fileinput/js/fileinput.js"></script>
<script type="text/javascript"  src="__JS__/other.js"></script>
<script type="text/javascript">
	//导航高亮
	highlight_subnav("<{:U('Songs/index')}>","<{:U('Genre/index')}>");
	var savePicPath	=	"<{:trim(C('ADMIN_UPPIC_PATH'))}>";
</script>
</block>	


